package xfuzzy.alg_genetico.indeterminado.xfghlOld.model;

import java.io.File;
//import java.util.ArrayList;

//import sun.awt.windows.ThemeReader;
//import sun.security.krb5.Config;

import xfuzzy.alg_genetico.indeterminado.xfghlOld.model.spec.XfghlInputType;
import xfuzzy.alg_genetico.indeterminado.xfghlOld.model.spec.XfghlOperSet;
import xfuzzy.alg_genetico.indeterminado.xfghlOld.model.spec.XfghlSpecification;
import xfuzzy.lang.Specification;
import xfuzzy.lang.XflException;
import xfuzzy.xfedit.Xfedit;
import xfuzzy.xfhl.model.XfhlData;

public class PruebaPobl {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
				
		
		//Incializamos el random
		XfghlSinglRandom.initialize(415);
	
		
		

		
		
		/**QUAKE 3 variables de entrada*/
		File file=new File("C:\\Documents and Settings\\Sergio\\Desktop\\XFGHL\\dee.dat");
		String name="Quake";
			
		int numEpocas=500;
	
		
		XfghlConfig config=new XfghlConfig(name,numEpocas,1,file,0.1,1.5,0.7,XfghlOperSet.AndOperatorProd,XfghlOperSet.DefuzOperatorFuzzyMean,XfghlInputType.FREE_TRIANGLES,3,0,20,50,0.3,0.5);		

		
		
		XfghlGeneration pob=new XfghlGeneration(config,true);	
		
	    
		for (XfghlChromosome c : pob.getChromosomes()) {
			
			System.out.println(c.toString());
		}
		
		
		
		Specification spec=null;
		
		XfhlData data=new XfhlData(1,numEpocas);
		
		try {
			
			spec= XfghlSpecification.create(pob.getChromosomes().get(0).getHierStruct(),config);
			
			Xfedit xedit=new Xfedit(null,spec);
			xedit.setVisible(true);
			
			XfghlThread thread=new XfghlThread(0,config,data);
			
			thread.run();
			
		} catch (XflException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println("El error es: "+data.getFinalError());

	}

}
